/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-02-09
 * Time: 13:01
 */
class Shape{
    public void draw(){

    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("♦");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}
    class Triangle extends Shape{
        @Override
        public void draw() {
            System.out.println("△");
        }
    }


/***************分割线******************/

public class TestDemo {
    //打印单个图形
    public static void drawMap(){
        Rect rect = new Rect();
        Flower flower = new Flower();
        Triangle triangle = new Triangle();

        Shape[ ] shapes = {triangle, rect, triangle, rect, flower};
        for (Shape shape : shapes) {
            shape.draw();
        }
    }
    public static void main(String[] args) {
        drawMap();
    }
}
